package com.atguigu.config;

import feign.Logger;
import feign.Retryer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zuife
 * @description
 * @since 2024-04-16 20:44:28
 */
@Configuration
public class FeignConfig {
    @Bean
    public Retryer myRetryer() {
        //return Retryer.NEVER_RETRY;//Feign默认不重试
        /**
         *  重试次数，重试间隔，最大延迟
         *  重试间隔默认1s
         *  最大延迟默认1分钟
         *  重试次数默认3次
         */
       return new Retryer.Default(100, 1, 3);
    }
    @Bean
    Logger.Level feignLoggerLevel() {
        return Logger.Level.FULL;
    }
}
